load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = [
    "//rs:ic-os-pkg",
    "//rs/orchestrator:__subpackages__",
])

rust_library(
    name = "server",
    srcs = glob(["src/**/*.rs"]),
    crate_name = "guest_upgrade_server",
    deps = [
        "//rs/ic_os/attestation",
        "//rs/ic_os/config:config_lib",
        "//rs/ic_os/config_types",
        "//rs/ic_os/guest_upgrade/shared",
        "//rs/ic_os/sev",
        "//rs/ic_os/vsock/vsock_lib",
        "//rs/interfaces",
        "//rs/interfaces/registry",
        "//rs/protobuf",
        "//rs/registry/client",
        "//rs/registry/helpers",
        "//rs/registry/local_store",
        "@crate_index//:anyhow",
        "@crate_index//:der",
        "@crate_index//:http-body-util",
        "@crate_index//:hyper",
        "@crate_index//:hyper-util",
        "@crate_index//:rcgen",
        "@crate_index//:rustls",
        "@crate_index//:sev",
        "@crate_index//:thiserror",
        "@crate_index//:tokio",
        "@crate_index//:tokio-rustls",
        "@crate_index//:tokio-stream",
        "@crate_index//:tokio-util",
        "@crate_index//:tonic",
        "@crate_index//:tower",
        "@crate_index//:tower-http",
        "@crate_index//:x509-parser",
    ],
)

rust_test(
    name = "server_test",
    crate = ":server",
)
